package Huihu.src.fuxi;

public class Luckly {
    public static void main(String[] args) {
        long a=59084709587505L;
        int sum=0;
        for (long i = 0; Math.pow(3,i)<a; i++)
            for (long j = 0; Math.pow(5,j)<a; j++)
                for (long k = 0; Math.pow(7,k)<a; k++)
                    if (Math.pow(3,i)*Math.pow(5,j)*Math.pow(7,k)<a) {
                        sum++;
                    }
        System.out.println(sum);
                }
}
